<template>
    <div class="student">
        <h2>学生姓名:{{name}}</h2>
        <h2>学生年龄:{{age}}</h2>
        <button @click="showMore">展示更多信息</button>
    </div>
</template>

<script>
export default {
    name:'Student',
    data() {
        return {
            name:'张三',
            age:18,
            gender:'男',
            subject:'前端'
        }
    },
    methods:{
        showMore(){
            alert(`性别:${this.gender},所学技术:${this.subject}`)
        }
    }
}
</script>

<style>
    .student{
        background-color: skyblue;
        padding: 20px;
    }
</style>
